package com.pine.dbant.common.plugin;

import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

/**
 *  操作参数
 * @author xiaoyuan
 * @create 2022/11/8 14:43
 **/
@Getter
@Setter
public class ExecuteParams<T extends ExecuteParams> implements Cloneable{
    /**
     * 执行脚本
     */
    private String script;
    /**
     * 执行参数
     */
    private Map<String, Object> properties;


    public T copy(){
        ExecuteParams executeParams = new ExecuteParams();
        executeParams.setScript(script);
        if(properties!=null){
            executeParams.setProperties(new HashMap<>(this.properties));
        }
        return (T) executeParams;
    }


}
